package com.dao;

import com.entity.ExamAnswerDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Version: V1.0    <br/>
 * Datetime:   2022/5/15 16:34   <br/>
 * Description: ${DES}
 *
 * @author: chen
 */
@Mapper
public interface ExamAnswerDetailMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ExamAnswerDetail record);

    int insertSelective(ExamAnswerDetail record);

    ExamAnswerDetail selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ExamAnswerDetail record);

    int updateByPrimaryKey(ExamAnswerDetail record);

    int deleteByQuestionId(@Param("questionId") Integer questionId);

    int deleteByExaminationPaperId(@Param("testPaperId") Integer testPaperId);

    /**
     * 根据试卷id和题目id删除答题详情
     *
     * @param userId  用户id
     * @param paperId 试卷id
     * @return 删除结果
     */
    int deleteByExaminationPaperIdAndUserId(@Param("userId") Integer userId, @Param("paperId") Integer paperId);

    int insertBatch(@Param("list") List<ExamAnswerDetail> list);

    List<ExamAnswerDetail> selectByUserIdAndPaperId(@Param("userId") Integer userId, @Param("testPaperId") Integer testPaperId);
}